home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Subject: Re: fastest code
- Date: 10 Apr 1996 13:21:36 -0500
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4kgu7g$n9a@solutions.solon.com>
- References: <316112A2.7D37@public.sta.net.cn> <1996Apr10.110121.6784@friend.kastle.com> <4kgbmj$j3j@solutions.solon.com> <4kghs7$250@news1.mnsinc.com>
- Reply-To: seebs@solon.com
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4kghs7$250@news1.mnsinc.com>,
- Szu-Wen Huang <huang@mnsinc.com> wrote:
- >Peter Seebach (seebs@solutions.solon.com) wrote:
- >: In article <1996Apr10.110121.6784@friend.kastle.com>,
- >: Richard Krehbiel <rich@kastle.com> wrote:
- >: >Oliver Hellwig <hellwig@rahul.net> wrote:
- >: >> for (i=0; i<16; i++)
- >: >> prom[i] = prom[i+i];
-
- >: HUH? the code as written has a clear effect, which is to shove all of
- >: the elements of an array over one. It certainly is an optimizer bug.
-
- >: Read the code carefully; the 2nd reference to prom[] uses a different
- >: index into the array. This is not a meaningless statement.
-
- >*You* read closely. The second index is "i+i". ;) Okay, so it's a
- >typo, but one who says "read carefully" is expected to. Cheers.
-
- Okay, so the code becomes undefined when i becomes 8.
-
- And does nothing when i is 0.
-
- But the intervening few cases would be expected to produce
- assignments.
-
- I still think eliminating the assignments is a bug, and that "volatile"
- should not have any effect, but I'll grant that it's far
- from the only problem.
-
- Wow.
-
- I can't read anymore, can I.
-
- -s
-
-
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-